set RECV_LISTEN(421) m_nocommand

set RECV_LISTEN(008) m_serverinfo
set RECV_LISTEN(381) m_serverinfo
set RECV_LISTEN(425) m_serverinfo

proc m_nocommand {chid raw parent me} {
	global n_conns
	global CHANS_$chid
	
	regexp {[^ ]+ 421 [^ ]+ ([^ ]+) :.+} $raw -> command
	
	set channel [$n_conns.$chid tab [$n_conns.$chid select] -text]	
	set out "console"
	if { $channel != "Console" } {
		set num [set "CHANS_$chid\([string tolower $channel]\)"]
		set out "chan$num"
	}
	
	errmsg $parent.$out "$command: [tr {Unknown command}]\n"
}

proc m_serverinfo {chid raw parent me} {
	global n_conns
	global CHANS_$chid
	
	regexp {[^ ]+ [^ ]+ [^ ]+ :(.+)} $raw -> message
	
	set channel [$n_conns.$chid tab [$n_conns.$chid select] -text]	
	set out "console"
	if { $channel != "Console" } {
		set num [set "CHANS_$chid\([string tolower $channel]\)"]
		set out "chan$num"
	}
	infomsg $parent.$out "$message\n"
}
